package Song.Han.Demo02;
/*
    ObjectInputStream:写对象，也叫对象的序列化
    构造方法：
        ObjectInputStream(InputStream is)

    反序列化的前提：
        1.类必须实现Serializable
        2.必须存在类对应的class文件
*/

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Demo02ObjectInputStream {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("E:\\IDeaProject\\Day15\\src\\Song\\Han\\Demo02\\person.txt"));

        Object obj = ois.readObject();//ClassNotFoundException
        ois.close();
        System.out.println(obj);
    }
}
